---
title: Load MCO enrollments
summary: Loads MCO plan enrollments for a provider location and validates each against the assigned plan ID.
status: draft
owner: SAIF Doc Gen
last_reviewed: 2026-08-21
library: SAIF.Business.View.Provider
reference_type: embedded
operation_id: OP-11
trigger: clsProviderLocation.MCOList navigation
---

# Load MCO enrollments

Loads all MCO plan enrollments for a provider location via a direct-query self-loading list, and attaches plan details retrieved from `SAIF.Business`, validating that the attached plan matches the assigned plan ID.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-11 |
| **Trigger** | `clsProviderLocation.MCOList` navigation |
| **Inputs** | `IDataPortalInfo`, provider-location ID |
| **Outputs** | `clsMCOProviderList` |
| **Primary components** | `clsMCOProviderList..ctor(dpi, providerLocationID)` |
| **Entry point** | `SAIF.Business.View.Provider/clsMCOProvider.vb:214` |

## Steps

1. Query [MCO_PROVIDER](../database-tables.md#mco_provider) bound on `:ProviderLocationID` ([SQL-MCO-01](../sql/SQL-MCO-01-mco-provider-plans.md)).
2. For each row, create a `clsMCOProvider`.
3. Call `SetPlan(GetMCOInfo(inDPI).Plan(prov.PlanID))` to attach plan details.
   - On failure: `SetPlan` throws `ApplicationException("MCO plan submitted does not match plan assigned.")` when the plan IDs differ ([BR-MCO-001](../business-rules.md#br-mco-001-mco-plan-must-match-the-assigned-plan-id)).
4. Each enrollment's effective window is evaluated with `IsInEffect(date)` / `IsActive` / `IsExpired`, per [BR-DATE-001](../business-rules.md#br-date-001-dated-records-are-in-effect-within-their-date-window).

   > **Origin**: Step 3's `GetMCOInfo(dpi)` call is implemented in `SAIF.Business` (a dependency package); its internal steps are not visible in this repository.**

## Process flow

The following diagram visualizes this operation's control flow.

```mermaid
flowchart TD
	Start([Caller request]) --> S1[Bind ProviderLocationID]
	S1 --> S2["Execute via<br>SqlHelper.ResultSetQuery"]
	S2 --> S3["Create clsMCOProvider per<br>row"]
	S3 --> S4[GetMCOInfo dpi .Plan PlanID]
	S4 --> S5{Plan ID matches assigned?}
	S5 -->|Yes| S6[SetPlan attaches MCOPlanInfo]
	S5 -->|No| S7([Throws ApplicationException])
	S6 --> EndOk([clsMCOProviderList returned])
```

## Failure and edge-case behavior

- No matching enrollments: an empty `clsMCOProviderList` is returned.
- Mismatched MCO plan ID vs. the plan already assigned raises `ApplicationException("MCO plan submitted does not match plan assigned.")` ([BR-MCO-001](../business-rules.md#br-mco-001-mco-plan-must-match-the-assigned-plan-id)).
- `GetMCOInfo` internals reside in `SAIF.Business` and were not traced from this repository.**

## Related documentation
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)
- [SQL catalog](../sql/index.md)
- [Database tables](../database-tables.md)

> **Note:** Statements marked with * were inferred from code structure, naming conventions, or
> contextual evidence where direct confirmation was not available in source artifacts. Statements
> marked with ** could not be confirmed; treat as unknown until verified.

## Sources
- `SAIF.Business.View.Provider/clsMCOProvider.vb`
